#ifndef DESKTOP_CONTEXT_MENU_EXTENSION_UTILS
#define DESKTOP_CONTEXT_MENU_EXTENSION_UTILS

#include <Windows.h>

//@Commit:For Debugging.change the firsr line '#ifndef' to '#ifdef' while output this dll.
#ifndef _DEBUG
#define __DebugLog(debug_msg) OutputDebugString(_TEXT(debug_msg) _TEXT("@Mapupcal"))

//@Commit:Using RAII technique.We can trace the Method Call through debug msg.
class __DebugFunctionCallRAII
{
public:
	static const UINT MAX_BUFFER_SIZE = 1024;
public:
	__DebugFunctionCallRAII(LPCSTR functionName)
	{
		m_FunctionName = functionName;
		char szBuffer[MAX_BUFFER_SIZE] = "\0";
		lstrcatA(szBuffer,"Method Call Begin:");
		lstrcatA(szBuffer,m_FunctionName);
		lstrcatA(szBuffer,"@Mapupcal");
		OutputDebugStringA(szBuffer);
	}
	~__DebugFunctionCallRAII()
	{
		char szBuffer[MAX_BUFFER_SIZE] = "\0";
		lstrcatA(szBuffer,"Method Call End:");
		lstrcatA(szBuffer,m_FunctionName);
		lstrcatA(szBuffer,"@Mapupcal");
		OutputDebugStringA(szBuffer);
	}
private:
	LPCSTR m_FunctionName;
};
#define  __DebugFunctionCall(func_name) __DebugFunctionCallRAII raii = __DebugFunctionCallRAII(func_name)
#else
#define __DebugLog(debug_msg) ;
#define __DebugFunctionCall(func_name) ;
#endif
#endif